<?php

class Operator extends CWidget {
	
	public $buttons = array();
	
	public function run() {
		if(!is_array($this->buttons)) return;
		$btns = $this->createButtons($this->buttons);
		foreach($btns as $btn) {
			if($btn->visible)
				echo $btn->generate();
		}
	}
	
	public function createButtons($buttons) {
		$btns = array();
		foreach($buttons as $label=>$one) {
			$one['label'] = $label;
			$one['class'] = 'OperatorButton';
			$btns[] = Yii::createComponent($one);
		}
		return $btns;
	}
	
}


?>